<template>
  <div class="container">
    <swiper
      ref="mySwiper"
      :options="swiperOption"
      class="swiper-box">
      <swiper-slide class="swiper-item"
        v-for="item in lunboList" :key="item.url">
        <img v-lazy="item.img" alt="lunbotu" :class="{ 'full': isFull }" />
      </swiper-slide> 

      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
  import { swiper, swiperSlide } from 'vue-awesome-swiper'
  import 'swiper/dist/css/swiper.css'

  export default {
    components: {
      swiper,
      swiperSlide
    },
    name: 'swiperBox',
    props: [ 'lunboList', 'isFull' ],
    data() {
      return {
        swiperOption: {
          autoplay: {
            delay: 3000
          },
          pagination: {
            el: '.swiper-pagination',
            clickable: true
          },
        }
      }
    },
  }
</script>

<style lang="less" scoped>
  .swiper-box {
    height: 200px;

    .swiper-item {
      text-align: center;

      img {
        height: 100%;
      }
    }
  }
  .full {
    width: 100%;
  }
</style>